package com.tjsinfo.tjsoa.vote.bo;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import com.tjsinfo.tjsoa.Dao.IQbcDao;
import com.tjsinfo.tjsoa.vote.dao.ITVoteEstimatedDAO;
import com.tjsinfo.tjsoa.vote.vo.TVoteEstimated;

public class TVoteEstimatedBO implements ITVoteEstimatedBO {
	
	private IQbcDao qbcDao;	
	private ITVoteEstimatedDAO estimatedDao;
	
	public IQbcDao getQbcDao() {
		return qbcDao;
	}
	public void setQbcDao(IQbcDao qbcDao) {
		this.qbcDao = qbcDao;
	}
	public ITVoteEstimatedDAO getEstimatedDao() {
		return estimatedDao;
	}
	public void setEstimatedDao(ITVoteEstimatedDAO estimatedDao) {
		this.estimatedDao = estimatedDao;
	}

	public void save(TVoteEstimated transientInstance) {
		// TODO Auto-generated method stub
		estimatedDao.save(transientInstance);
	}

	public List find(String headId){
		DetachedCriteria criteria = DetachedCriteria.forClass(TVoteEstimated.class);
		criteria.add(Restrictions.eq("headId", headId));
		List list = qbcDao.getCriteria(criteria);
		return list;
	}
	public void delete(String id) {
		// TODO Auto-generated method stub
		estimatedDao.delete(id);
	}
	public TVoteEstimated findById(String id) {
		// TODO Auto-generated method stub
		return estimatedDao.findById(id);
	}
	public void deleteA(String headId) {
		// TODO Auto-generated method stub
		estimatedDao.deleteA(headId);
	}
	
}
